import { assert } from "../assert";

export function padToNBytes(byteLength, padding) {
  assert(byteLength >= 0); // `Incorrect "byteLength" value: ${byteLength}`
  assert(padding > 0); // `Incorrect "padding" value: ${padding}`
  return (byteLength + (padding - 1)) & ~(padding - 1);
}
